<%@ include file="/common/taglibs.jsp"%>
<probiz:pageHeading pageHeadingKey="appRoleList.heading" />

<content tag="buttons">
	<probiz:iconBtn btnType="add" onclick="fnDoAdd(this)" />
	<probiz:iconBtn btnType="delete" onclick="fnDoMultiDelete(this)" />
</content>

<search:searchBox formAction="${ctxPath}/system/frontRole.html" enableMoreSearch="false">
	<div class="basic_search">
		<search:basicSearch attrPath="s.roleName" attrNameKey="appRole.roleName" datatype="String" operator="LIKE" classes="inputtxt" labelWidth="70px"/>
	</div>
</search:searchBox>

<form class="mainForm" name="appRoleListForm" method="post" action="${ctxPath}/system/frontRole.html">
	<div class="data">
		<div class="top clearfix">
			<ul class="tab">
				<li class="curr"><span><fmt:message key="appRoleList.heading"/></span></li>
			</ul>
			<%@include file="/common/pagingOnlyTop.jsp"%>
		</div>
		<c:set var="editURLPath" value="/system/frontRole.html?doAction=edit&from=list" scope="page" />
		<c:set var="checkAll"><input type="checkbox" name="allbox" onclick="fnSelectAllRows(this.form)" class="checkbox"/></c:set>
		<display:table name="${appRoleList}" uid="appRoleItem"	class="list_table" export="false" requestURI="" style="width: 100%">
			<display:column style="width: 3%" title="${checkAll}" media="html">
				<c:choose>
					<c:when test="${DEFAULT_ADMIN_ROLE_NAME eq appRoleItem.roleName}">
						<input type="checkbox" class="checkbox" title="${appRoleItem.roleName}" disabled="disabled"/>
					</c:when>
					<c:otherwise>
						<input type="checkbox" name="multiIds" value="${appRoleItem.roleId}" class="checkbox" title="${appRoleItem.roleName}"/>
					</c:otherwise>
				</c:choose>
			</display:column>
			<display:column style="width: 18%" sortable="false" url="${editURLPath}" paramId="appRoleId" paramProperty="roleId"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="appRole.roleName">
				${appRoleItem.roleName}
			</display:column>
		    <display:column style="width: 35%" property="roleDetail" sortable="false" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="appRole.roleDetail"/>
		    <display:column style="width: 20%" property="createTime" sortable="false" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="common.message.createTime"/>
		    <display:column property="updateTime" sortable="false" headerClass="data-table-title"
        		decorator="com.probiz.estore.core.decorator.TblColumnDecorator" titleKey="common.message.updateTime"/>
		</display:table>
		<%@include file="/common/pagingOnly.jsp"%>
		</div>
</form>
<script type="text/javascript">
highlightTableRows("appRoleItem");

/*全选列表页首列的checkbox*/
function fnSelectAllRows(theForm) {
	if (theForm) {
		var idCheckboxs=document.getElementsByName("multiIds");
		for (i=0;i<idCheckboxs.length;i++) {
			idCheckboxs[i].checked=theForm.allbox.checked;
		}
	} 
}

</script>